package com.superhelper.common.service;

import com.superhelper.common.domain.ExtMsg;

/**
 * 
 */
public class PushService {
    private XiaomiPushService xmPushService;
    private AliYunPushService aliPushService;

    public void setXmPushService(XiaomiPushService xmPushService) {
        this.xmPushService = xmPushService;
    }

    public void setAliPushService(AliYunPushService aliPushService) {
        this.aliPushService = aliPushService;
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.guzhi.service.push.PushService#send(java.lang.String,
     * java.lang.String, java.util.List)
     */
    public boolean push(String title, String content, String playload, final String target, String device, ExtMsg msg) {
        boolean returnValue = false;
        // if (!StringUtils.containsIgnoreCase(device, Consts.Device.IOS)) {
        // returnValue = xmPushService.push(title, content, playload, target,
        // device, msg);
        // } else {
        returnValue = aliPushService.push(title, content, device, target, msg);
        // }

        return returnValue;
    }

    public boolean sendToUser(String title, String playload, final String account, ExtMsg extras) {
        boolean result = false;
//        result = this.xmPushService.sendToUser(title, playload, account, extras);
		result = this.aliPushService.sendToUser(title, playload, account,
				extras);
        return result;
    }

}
